// 引入组件
import svgIcon from "./components/svgIcon/index.vue"

// 引入 element-plus 图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue"

const allGlobalComponent = {
    svgIcon,
}

export default {
    install(app) {
        // 遍历挂载为全局组件
        Object.keys(allGlobalComponent).forEach((key: string) => {
            app.component(key, allGlobalComponent[key])
        })
        // 挂载 element-plus 图标为全局组件
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component)
        }
    },
}
